<!-- INCLUDE header.html -->

<div id='content'>
	<!-- INCLUDE left.html -->
	<div id="right">
		<div id="slideshow">
			{foreach(model('slideshow')->get_list(array('status'=>1)) as $s)}
				<a href="{$s['url']}" title="{$s['name']}" class="slideshow-image"><img src="{thumb($s['image'],715,280)}" /></a>
			{/foreach}
		</div>
		<div class="list-title">Latest Products</div>
		<div class="list-wrapper">
			{foreach(model('product')->get_list(array('new'=>1,'total'=>16)) as $c)}
			<div class="list-item">
				<div class="title">{$c['name']}</div>
				<div class="img">
					<a href="?cat/{$c['category_id']}" title="{$c['name']}"><img alt="{$c['name']}" src="{thumb($c['image'],150,120)}" /></a>
				</div>
				<div class="info">
					<a href="?cat/{$c['category_id']}">View All&gt;&gt;</a>
				</div>
			</div>
			{/foreach}
			<div class="clear"></div>
		</div>
	</div>
	<div class="clear"></div>
</div>
<script>
$(function()
{
	if ($('.slideshow-image').length > 1)
	{
		slideshow();
		var t = {intval($config['slideshow_interval'])};
		if (t <= 0) t = 3000;
		setInterval(slideshow,t);
	}
});
function slideshow()
{
	var current = $('.slideshow-image[current]');
	if (!current.length) current = $('.slideshow-image:last').attr('current','true');
	var nxt = current.next();
	if (!nxt.hasClass('slideshow-image'))
	{
		nxt = $('.slideshow-image').eq(0);
	}
	nxt.css('z-index',2).attr('current','true');
	current.removeAttr('current').css('z-index',3).fadeOut(300,function()
	{
		$(this).css('z-index','1').show();
	});
}
</script>

<!-- INCLUDE footer.html -->